from datetime import datetime

from django.contrib.auth.models import User
from django.db import models

# Create your models here.

class Token(models.Model):
    """token"""

    accesstoken = models.CharField(max_length=255, verbose_name='token', help_text='token')
    user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='用户', help_text='用户')
    createdTime = models.DateTimeField(auto_now_add=datetime.now(), verbose_name='创建时间', help_text='创建时间')
    updatedTime = models.DateTimeField(auto_now=datetime.now(), verbose_name='更新时间', help_text='更新时间')

    class Meta:

        verbose_name = 'token'
        verbose_name_plural = verbose_name

    def __str__(self):

        return self.accesstoken